{% extends "master.html" %}

{% block title %}Хэрэглэгчийн бүртгэлийн мэдээлэлд өөрчлөлт оруулах{% endblock %}

{% block script %}
<script type="text/javascript">
function saveProfileData()
{
	document.forms['save_profile_data'].submit();
}

function deleteGender(id)
{
	window.location.href = '/delete_gender?id=' + id;
}

function deleteOccupation(id)
{
	window.location.href = '/delete_occupation?id=' + id;
}
</script>
{% endblock %}

{% block content %}
	{% if user %}
		<form name="save_profile_data" method="POST">
			<table align="center">
				<tbody>
					<tr>
						<td><center><strong><p>Хэрэглэгчийн бүртгэлийн мэдээлэлд өөрчлөлт оруулах</p></strong></center></td>
					</tr>
				</tbody>
			</table>
			<table align="center">
				<tbody>
					<tr>
						<td>Хүйс: </td>
						<td><input type="text" name="gender" /></td>
						<td><input type="button" value="Хадгалах" onclick="saveProfileData()" /></td>
					</tr>
					{% for gender in gender_list %}
						<tr>
							<td></td>
							<td>{{ gender.gender }}</td>
							<td><a href="javascript:deleteGender({{ gender.key.id }})"><img src="images/delete.png" width="16" height="16" title="Устгах" /></td>
						</tr>
					{% endfor %}
					<tr>
						<td>Ажил мэргэжил: </td>
						<td><input type="text" name="occupation" /></td>
						<td><input type="button" value="Хадгалах" onclick="saveProfileData()" /></td>
					</tr>
					{% for occupation in occupation_list %}
						<tr>
							<td></td>
							<td>{{ occupation.occupation }}</td>
							<td><a href="javascript:deleteOccupation({{ occupation.key.id }})"><img src="images/delete.png" width="16" height="16" title="Устгах" /></td>
						</tr>
					{% endfor %}
				</tbody>
			</table>
		</form>
	{% endif %}
{% endblock %}

{% block sidebar %}{% include "admin.html" %}{% endblock %}